package com.qdlc.p2p.biz.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qdlc.p2p.biz.service.UserLoginExtService;
import com.qdlc.p2p.dal.common.model.jpa.QueryParam;
import com.qdlc.p2p.dal.dao.UserLoginExtDao;
import com.qdlc.p2p.dal.dto.UserLoginExt;

@Service("userLoginExtService")
public class UserLoginExtServiceImpl implements UserLoginExtService {

    @Resource
    private UserLoginExtDao userLoginExtDao;

    @Override
    public UserLoginExt find(long userId) {
        return userLoginExtDao.findObjByProperty("userId", userId);
    }

    @Override
    public long getUserIdByUserName(String userName) throws Exception {
        return userLoginExtDao.getUserIdByUserName(userName);
    }

    @Override
    public int count(QueryParam param) {
        return userLoginExtDao.countByCriteria(param);
    }
}